package com.shuai.frame.registry;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 本地注册中心
 */
public class LocalRegister {
    private static final ConcurrentHashMap<String, Class<?>> localContainer = new ConcurrentHashMap<>();

    public static void register(String serviceName, Class<?> implClass) {
        localContainer.put(serviceName, implClass);
    }

    public static Class<?> getService(String serviceName) {
        return localContainer.get(serviceName);
    }

    public static boolean remove(String serviceName) {
        return localContainer.remove(serviceName) != null;
    }
}
